Hi,
for lockItem in lcklist do {
username = lockItem.user
ld = lockItem.date
logDate = dateOnly(ld)""
todayDate = dateOnly(today)""
User u = find(username)
uEmail = u.email
put(uName, uEmail, uEmail)
Group g = find("Administrators group")//I also want to send this group an email
u
for u in g do{
uEmail = u.email
put(uName, uEmail, uEmail)
}
}
for uEmail in uName do{
Skip emailTo = create
//put (emailTo, 1, sFrom)
put (emailTo, 2, uEmail[0:])
sMsg = "DOORS User," nL nL//-
"Message" nL nL //-
"mailto:"sFrom""
sendEMailNotification(sFrom, emailTo, sSub, sMsg)
delete(emailTo)
}
SystemAdmin - Tue Aug 21 13:35:28 EDT 2012 |
Re: Locks in Database I assume uName is of type Skip. Could it be that you created it by "create" instead of "createString"? Is this single "u" in line 12 is really in your code? Rgds, Mike |
Re: Locks in Database Perhaps you mis-spelled "Administrators Group" or you lack "R" access to it's contents. Perhaps the admins have not specified their emails. Sure seems to me you want a single Email to go out to everybody. Seems in this case the Admins are going to get an email that simply says someone has something locked. -Louie |
Re: Locks in Database I have another guess. You are falling for auto-declare mischief! Since you are only declaring a few variables in your code, my guess is that you have auto-declare turned on and DXL will make the following from your code!
Group g = find("Administrators group")//I also want to send this group an email
for u in g do{
UserRef__ uEmail = u.email
put(uName, uEmail, uEmail)
}
what you would want is:
Group g = find("Administrators group")//I also want to send this group an email
for u in g do{
string uEmail = u.email
put(uName, uEmail, uEmail)
}
Explanation: The "." syntax in DXL is not a feature of the language. Instead it is enabled by undocumented types and operators. So the following functions make sure that you can user user.email: UserRef__ ::. (User, UserElement) // extracts the requested property from the User UserElement email () // stores the info that we want the email property string ::= (string &s, UserRef__ x) // assign a UserRef to a string string s = user.email is translated to ::= (string &s, UserRef__ ::. (User user, UserElement email()))
If you do NOT declare uEmail the DXL parser cannot possibly know what you want here. Therefore instead of putting strings to your skip you will be putting UserRef__ objects to your Skip. So try declaring all your variables, turn autodeclare off (look in the forum) and try again.
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: Locks in Database llandale - Tue Aug 21 16:41:09 EDT 2012 It works, just a mispelling error, however I want the email to have all the names that it went to in the "TO". I want the Administrators to know everyone the emails went out to. Right now the "To" just has the name of the person receiving the email. |
Re: Locks in Database SystemAdmin - Tue Aug 28 10:15:34 EDT 2012 Thanks!! |